import request from "@/utils/request"
import config from "@/config"

export default {
    add: {
        url: `${config.API_PREFIX}/generator/row`,
        name: "导入生成行",
        post: function (intoSysTable) {
            return request.post(this.url, intoSysTable);
        }
    },
    del: {
        url: `${config.API_PREFIX}/generator/row`,
        name: "单（多）选删除生成行",
        delete: function (ids) {
            return request.delete(this.url, ids);
        }
    },
    edit: {
        url: `${config.API_PREFIX}/generator/row`,
        name: "修改生成行",
        put: function (editDto) {
            return request.put(this.url, editDto);
        }
    },
    info: {
        url: `${config.API_PREFIX}/generator/row`,
        name: "根据主键查询生成行",
        get: function (id, isExtend = false) {
            return request.get(this.url + `/${id}`, {isExtend: isExtend});
        }
    },
    lists: {
        url: `${config.API_PREFIX}/generator/row/lists`,
        name: "（可分页）查询生成行列表",
        get: function (queryDto) {
            return request.get(this.url, queryDto);
        }
    },
    tableList: {
        url: `${config.API_PREFIX}/generator/row/tableList`,
        name: "（可分页）查询生表信息列表",
        get: function (queryTable) {
            return request.get(this.url, queryTable);
        }
    },
    preview: {
        url: `${config.API_PREFIX}/generator/row/preview`,
        name: "（预览）根据主键列表生成代码",
        get: function (id) {
            return request.get(this.url + `/${id}`);
        }
    },
    download: {
        url: `${config.API_PREFIX}/generator/row/download`,
        name: "（下载）根据主键列表生成代码",
        get: function (id, name) {
            request.download(this.url + `/${id}`, name);
        }
    },
}